<?php

  
require_once FRAMEWORK_DIR."/libraries/pfp/genericobject.php";

class GenericObjectTestCaseOutput extends UnitTestCase {

function setUp(){
	

}
function testGenericObjectInstance() {
	
	//print_r(NGenericObject::newInstance('testtable','id'));
        $this->assertClone(NGenericObject::NI('testtable2','id'),NGenericObject::NI('testtable2','id'), "%s -> Pass");
 	
            
        }
function testFunctions(){
	$oUser = NGenericObject::newInstance('#__user');
	$oUser->SetField("name","bobd");
	$oUser->save();	
	$id = $oUser->GetID();
	unset ($oUser);
	$oUser = NGenericObject::newInstance('#__user',$id);
	$this->assertEqual($id,$oUser->GetID(),"%s -> Pass");
	$this->assertEqual($id,$oUser->getField('id'),"%s -> Pass");
	$this->assertEqual($oUser->GetID(),$oUser->getField('id'),"%s -> Pass");
	$oUser->setField("name","bob2");

	$oUser->Destroy();
	
	//$this->assertEqual($oUser->getField('id'),NULL,"%s -> Pass");
	$this->assertEqual($oUser->getID(),$id,"%s -> Pass");
	
	
}



}


?>